using System;

using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;



namespace Microsoft.NETMF.BikeComputer.Application
{
    public class DataView : View
    {
        private UIButton _saveToSD;
        private UIButton _saveToWeb;

        public DataView(RideDataModel model)
            : base(model)
        {

            StackPanel _dataPanel = new StackPanel(Orientation.Vertical);
            _dataPanel.HorizontalAlignment = HorizontalAlignment.Center;
            _dataPanel.VerticalAlignment = VerticalAlignment.Center;

            ////////////////////////////////////////////////////////////////////////////////////////
            //  title area
            //

            StackPanel titlePanel = new StackPanel(Orientation.Horizontal);
            titlePanel.HorizontalAlignment = HorizontalAlignment.Center;
            titlePanel.VerticalAlignment = VerticalAlignment.Top;

            Text titleText = new Text(Resources.GetFont(Resources.FontResources.nina48), Resources.GetString(Resources.StringResources.DataTitle));
            titleText.HorizontalAlignment = HorizontalAlignment.Center;
            titleText.VerticalAlignment = VerticalAlignment.Top;

            titlePanel.Children.Add(titleText);

            ////////////////////////////////////////////////////////////////////////////////////////
            //  button area
            //

            StackPanel buttonPanel = new StackPanel(Orientation.Vertical);
            buttonPanel.HorizontalAlignment = HorizontalAlignment.Center;
            buttonPanel.VerticalAlignment = VerticalAlignment.Center;


            _saveToSD = new UIButton(Resources.GetString(Resources.StringResources.SDButton), Resources.GetFont(Resources.FontResources.nina14), 120, 35);
            _saveToSD.Click += new EventHandler(_saveToSD_Click);
            _saveToSD.SetMargin(10, 10, 0, 20);


            _saveToWeb = new UIButton(Resources.GetString(Resources.StringResources.WebButton), Resources.GetFont(Resources.FontResources.nina14), 120, 35);
            _saveToWeb.Click += new EventHandler(_saveToWeb_Click);
            _saveToWeb.SetMargin(10, 0, 0, 20);


            buttonPanel.Children.Add(_saveToSD);
            buttonPanel.Children.Add(_saveToWeb);



            ///////////////////////////////////////////////////////////////////////////////////////
            //  panel Setup
            //

            _dataPanel.Children.Add(titlePanel);
            _dataPanel.Children.Add(buttonPanel);

            Child = _dataPanel;

        }

        //--//

        #region button handlers

        void _saveToSD_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void _saveToWeb_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }


        #endregion

    }
}
